﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using AdaptiveHelpDesk;

namespace Novice.Services
{
    /// <summary>
    /// Summary description for TaskModel
    /// </summary>
    [WebService(Namespace = "http://soaiui.nmmu.ac.za/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class TaskModel : System.Web.Services.WebService
    {
        GetTaskModel gt = new GetTaskModel();
        
        [WebMethod]
        public void StepComplete(int step)
        {
            switch (step)
            {
                case 1:
                    gt.setSearchCustomerStatus("Complete");
                    break;
                case 2:
                    gt.setLogACallStatus("Complete");
                    break;
                case 3:
                    gt.setAssignCallStatus("Complete");
                    break;
                case 4:
                    gt.setProvideSolutionStatus("Complete"); 
                    // persist this information somewhere...e.g. database or something. Check what bronwin did
                    reset();
                    break;
                case 5:
                    CompleteAll();
                    break;
            }
        }

        private void CompleteAll()
        {
            gt.setSearchCustomerStatus("Complete");
            gt.setLogACallStatus("Complete");
            gt.setAssignCallStatus("Complete");
            gt.setProvideSolutionStatus("Complete");
            reset();
        }

        private void reset()
        {
            gt.setSearchCustomerStatus("");
            gt.setLogACallStatus("");
            gt.setAssignCallStatus("");
            gt.setProvideSolutionStatus("");
        }
    }
}
